<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib prefix="product" tagdir="/WEB-INF/tags/product"%>
<%@ taglib prefix="order" tagdir="/WEB-INF/tags/order"%>

<div class="settings_wrap" id="customerAndProductDiv">
	<div class="top clearfix">
		<h3>
			<fmt:message key="salesOrder.editPanel.process.step1" />
		</h3>
	</div>
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr>
			
			<td style="vertical-align:top;">
				<div class="content">
					<div class="box_04">
						<div class="cnt">
							<div class="top">
								<fmt:message key="salesOrder.editPanel.process.product4Add" />
							</div>
							<table width="100%" border="0" cellspacing="0" cellpadding="0" class="list_table" id="productSkuTable" height="60px;">
								<tr>
									<th width="80px;"><fmt:message key="orderSku.image"/></th>
									<th width="100px;"><fmt:message key="productSku.productSkuCode"/></th>		    
									<th><fmt:message key="orderSku.productSku"/></th>		    
									<th width="100px"><fmt:message key="orderSku.quantity"/></th>	  
									<th width="80px">
										<a href="javascript:void(0)" onclick="showDialogOfproductSkuSelector()" class="none"><span class="add_prod"></span><fmt:message key="salesOrder.editPanel.process.product4Add"/></a>
									</th>  
								</tr>
								<tr id="addHint">
									<td colspan="5" align="center"><font color="green"><b><a href="javascript:void(0)" onclick="showDialogOfproductSkuSelector()"><fmt:message key="salesOrder.editPanel.product.plsAddProduct"/></a></b></font></td>
								</tr>
							</table>
						</div>
					</div>
				</div>
				<c:if test="${not empty order.orderSkus4Gc}">
					<br/>
					<div class="content">
						<div class="box_04">
							<div class="cnt">
								<div class="top">
									<fmt:message key="salesOrder.editPanel.giftCertificate" />
								</div>
								<table width="100%" border="0" cellspacing="0" cellpadding="0" class="list_table" id="" height="60px;">
									<tr>
										<th><fmt:message key="orderSku.giftCertificate.giftCertificateNo"/></th>		    
										<th width="100px"><fmt:message key="orderSku.price"/></th>	  
										<th width="60px"><fmt:message key="orderSku.quantity"/></th>	  
									</tr>
									<c:forEach items="${order.orderSkus4Gc}" var="orderSku">
										<tr>
											<td>
												${orderSku.giftCertificate.giftCertificateNo} 
											</td>
											<td>
												<common:currencyFormat value="${orderSku.price}" />
												<%-- 重要，记录订单使用的礼券金额，为了之后的订单计算中与前台下单数据保存一致--%>
												<input type="hidden" name="giftCertAmts" value="${orderSku.price}"/>
											</td>
											<td>
												${orderSku.quantity}
											</td>
										</tr>
									</c:forEach>
								</table>
							</div>
						</div>
					</div>
				</c:if>
			</td>
			<td style="vertical-align:top;width:10px;">
			</td>
			<td style="vertical-align:top;width:30%;">
				<div class="content" >
					<div class="box_04">
						<div class="cnt">
							<div class="top">
								<fmt:message key="salesOrder.editPanel.process.customer4Add" />
							</div>
							<table width="100%" border="0" cellspacing="0" cellpadding="0" class="settings_table1"  height="60px;">
								<c:choose>
									<c:when test="${not empty order.customer}">
										<tr>
											<th width="100px;">
												<fmt:message key="salesOrder.customerUsername" />:
											</th>
											<td>
												${order.customer.username}
												
												<input type="hidden" name="customerId" value="${order.customer.customerId}"/>
											</td>
										</tr>
										<tr>
											<th>
												<fmt:message key="salesOrder.customerFirstname" />:
											</th>
											<td>
												${order.customer.firstname}
											</td>
										</tr>
										<tr>
											<th>
												<fmt:message key="salesOrder.customerEmail" />:
											</th>
											<td>
												${order.customer.email}
											</td>
										</tr>
										<tr>
											<th>
												<fmt:message key="salesOrderView.customer.membership" />:
											</th>
											<td>
												${order.customer.membership.membershipName}
											</td>
										</tr>
										<tr>
											<th>
												<fmt:message key="salesOrderView.customer.shopPoint.total" />:
											</th>
											<td>
												${order.customer.shopPoint.total}
											</td>
										</tr>
										<tr>
											<th>
												<fmt:message key="salesOrderView.customer.customerArea" />:
											</th>
											<td>
												${order.customer.customerArea}
											</td>
										</tr>
										<tr>
											<th>
												<fmt:message key="salesOrderView.customer.createTime" />:
											</th>
											<td>
												<common:datetimeFormat date="${order.customer.createTime}" />
											</td>
										</tr>
										<tr>
											<th>
												<fmt:message key="salesOrderView.customer.lastLoginTime" />:
											</th>
											<td>
												<common:datetimeFormat date="${order.customer.lastLoginTime}" />
											</td>
										</tr>
									</c:when>
									<c:otherwise>
										<tr>
											<td>
												<fmt:message key="salesOrderView.customer.anonymous"/>
												
												<input type="hidden" name="customerId" value=""/>
											</td>
										</tr>
									</c:otherwise>
								</c:choose>
								
							</table>
						</div>
					</div>
				</div>
			</td>
			
		</tr>
	</table>
</div>